﻿<%@ Page language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full"  %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<asp:Content ID="Content2" ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
	<!-- load CSS files -->
	<SharePoint:CssRegistration ID="CssRegistration0" After="corev4.css" runat="server"
				name="<% $SPUrl:~SiteCollection/SiteAssets/AIR/css/smoothness/jquery-ui-1.10.0.custom.css%>"/>
	<SharePoint:CssRegistration ID="CssRegistration1" After="corev4.css" runat="server"
				name="<% $SPUrl:~SiteCollection/SiteAssets/AIR/css/pretty-json.css%>"/>
	<SharePoint:CssRegistration ID="CssRegistration2" After="corev4.css" runat="server"
				name="<% $SPUrl:~SiteCollection/SiteAssets/AIR/css/air.css?ver=1.0%>"/>
	
	<!-- load SP files (chrome does not seem to load SP.js without explicitly loading via scriptlink) -->
	<SharePoint:ScriptLink ID="ScriptLink0a" runat="server" Defer="false" LoadAfterUI="true" Localizable="false" 
				  Name="SP.Runtime.js"/>
	<SharePoint:ScriptLink ID="ScriptLink0b" runat="server" Defer="false" LoadAfterUI="true" Localizable="false" 
				  Name="SP.js"/>

	<!-- load client web tech -->
	<SharePoint:ScriptLink ID="ScriptLink1" runat="server" Defer="false" LoadAfterUI="True"
				  Name="~sitecollection/SiteAssets/AIR/js/jquery-ui-1.10.0.custom.min.js"/>
	<SharePoint:ScriptLink ID="ScriptLink2" runat="server" Defer="false" LoadAfterUI="True"
				  Name="~sitecollection/SiteAssets/AIR/js/underscore-min.js"/>
	<SharePoint:ScriptLink ID="ScriptLink3" runat="server" Defer="false" LoadAfterUI="True"
				  Name="~sitecollection/SiteAssets/AIR/js/backbone-min.js"/>
	<SharePoint:ScriptLink ID="ScriptLink4" runat="server" Defer="false" LoadAfterUI="True"
				  Name="~sitecollection/SiteAssets/AIR/js/pretty-json-min.js"/>
	<SharePoint:ScriptLink ID="ScriptLink5" runat="server" Defer="false" LoadAfterUI="True"
				  Name="~sitecollection/SiteAssets/AIR/js/jquery.tagcloud.js"/>
	<SharePoint:ScriptLink ID="ScriptLink6" runat="server" Defer="false" LoadAfterUI="True"
				  Name="~sitecollection/SiteAssets/AIR/js/jsrender.js"/>

	<!-- load my app scripts -->
	<SharePoint:ScriptLink ID="ScriptLink7" runat="server" Defer="false" LoadAfterUI="True"
				  Name="~sitecollection/SiteAssets/AIR/js/air.js?ver=1.0"/>
	<SharePoint:ScriptLink ID="ScriptLink8" runat="server" Defer="false" LoadAfterUI="True"
				  Name="~sitecollection/SiteAssets/AIR/js/pdogs-air.js?ver=1.0"/>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderId="PlaceHolderMain" runat="server">
	<div id="air">
		<div id="air-bg"></div>
		<div id="air-outer">
			<h1><a title="click to visit the companion post" href="http://platinumdogs.me/2013/03/14/sharepoint-adventures-with-the-rest-api-part-1/" target="_blank">Adventures with the SharePoint REST API.</a></h1>
			<div id="air-top" class="border">
				<div style="float:right; width:6%;">
					<a id="run" href="#" title='run the query'>Run</a>
				</div>
				<div style="float:left;width:94%;">
					<textarea id="query" title="type your query here, press ENTER to run the query"></textarea>
				</div>
				<div class="clearfix"></div>
			</div>
			<div>
				<div id="air-leftouter" class="air-boxmodel border">
					<div id="air-leftinner">
						<h3>REST Keywords:</h3>
						<a href="#" rel="3" class='resttag' itag='$select=' title='Query Option: restricts the columns returned  by the query ~ a comma-separated list of properties returned for each entry; property names are SharePoint column display names with all space removed. e.g. $select=Title,ID'>$select</a>
						<a href="#" rel="3" class='resttag' itag='$orderby=' title='Query Option: involved in client/server driven paging and controls the order of the returned results ~ a comma-separated list of properties with optional “asc” (default) or “desc”, e.g. $orderby=Title desc'>$orderby</a>
						<a href="#" rel="3" class='resttag' itag='$filter=' title="Query Option: filters the results returned  by the query ~ a boolean expression which determines whether an entry is returned, e.g. $filter=Title eq 'My Record'">$filter</a>
						<a href="#" rel="3" class='resttag' itag='$expand=' title='Query Option: expands data inline with the query results ~ a comma-separated list of property names causing related [User Person or Group, Lookup and Choice] data to be expanded inline with the results, e.g. $expand=Task would expand related Task data inline with each entry'>$expand</a>
						<a href="#" rel="1" class='resttag' itag='$skip=1' title='Query Option [client driven paging]: determines how many entries to skip before returning the results, e.g. $skip=4'>$skip</a>
						<a href="#" rel="1" class='resttag' itag='$top=1' title='Query Option [client/server driven paging]: returns the first n entries according to the ordering set by the orderby clause, e.g. $top=4'>$top</a>
						<a href="#" rel="1" class='resttag' itag='$inlinecount=allpages' title='Query Option: results will also include the number of entries without the filter applied, e.g. $top=4&$inlinecount=allpages'>$inlinecount</a>
						<a href="#" rel="1" class='resttag' itag='$skiptoken=1' title='Query Option [server driven paging]: sets the server continuation point for returning data, separate multiple key values using a comma, key values must refer to the orderby clauses used followed by the implicit "Id" key ~ skips to the {skiptoken}+1 entry before returning data, e.g. $skiptoken=4 will return entries beginning with Id = 5'>$skiptoken</a>
						<a href="#" rel="2" class='resttag' itag='$value' title='when appended to the base service URI, allows REST to return only the value of a property name, e.g. ListName/(1)/Title/$value'>$value</a>
						<a href="#" rel="2" class='resttag' itag='$metadata' title='when appended to the base service URI, returns information about the entity-sets, e.g. /_vti_bin/listdata.svc/$metadata'>$metadata</a>
						<a href="#" rel="1" class='resttag' itag='' title="a datetime literal, e.g. datetime'2013-03-12T12:01:38Z' or datetime'2013-03-12'">datetime</a>
						<a href="#" rel="1" class='resttag' itag='' title="a time literal, e.g. time'12:01:38'">time</a>
						<a href="#" rel="1" class='resttag' itag='' title='' style='display:none;'>datetimeoffset</a>
						<a href="#" rel="1" class='resttag' itag='' title="a GUID literal, e.g. guid'1225c695-cfb8-4ebb-aaaa-80da344efa6a'">guid</a>
						<a href="#" rel="1" class='resttag' itag=' null' title='literal token used for comparison with null, e.g. Title ne null'>null</a>
						<a href="#" rel="1" class='resttag' itag=' and' title='logical and'>and</a>
						<a href="#" rel="1" class='resttag' itag=' or' title='logical or'>or</a>
						<a href="#" rel="1" class='resttag' itag=' not' title='logical not'>not</a>
						<a href="#" rel="1" class='resttag' itag=' add' title='addition operator, e.g. Id add 1 eq 2'>add</a>
						<a href="#" rel="1" class='resttag' itag=' sub' title='subtraction operator, e.g. Id sub 1 eq 2'>sub</a>
						<a href="#" rel="1" class='resttag' itag=' div' title='division operator, e.g. Id div 2 eq 4'>div</a>
						<a href="#" rel="1" class='resttag' itag=' mul' title='multiplication operator, e.g. Id mul 2 eq 4'>mul</a>
						<a href="#" rel="1" class='resttag' itag=' mod' title='modulo operator, e.g. Id mod 2 eq 0'>mod</a>
						<a href="#" rel="2" class='resttag' itag=' lt' title='less than operator, e.g. Id lt 10'>lt</a>
						<a href="#" rel="2" class='resttag' itag=' le' title='less or equal operator, e.g. Id le 10'>le</a>
						<a href="#" rel="2" class='resttag' itag=' gt' title='greater than operator, e.g. Id gt 10'>gt</a>
						<a href="#" rel="2" class='resttag' itag=' ge' title='greater or equal operator, e.g. Id ge 10'>ge</a>
						<a href="#" rel="2" class='resttag' itag=' eq' title="equals operator, e.g. Id eq 10 or Title eq 'My Title'">eq</a>
						<a href="#" rel="2" class='resttag' itag=' ne' title="not equals operator, e.g. Id ne 10 or Title ne 'My Title'">ne</a>
						<a href="#" rel="2" class='resttag' itag="endswith(x,y)" title="filter method: indicates whether the first parameter ends with the second parameter (case-insenstive), e.g. endswith(Title,'1.1')">endswith</a>
						<a href="#" rel="1" class='resttag' itag="indexof(x,y)" title="filter method: returns the zero-based index of the second parameter within the first parameter, e.g. indexof(Title,'1.1') eq 0">indexof</a>
						<a href="#" rel="1" class='resttag' itag='' title='' style='display:none;'>replace</a>
						<a href="#" rel="2" class='resttag' itag="startswith(x,y)" title="filter method: indicates whether the first parameter starts with the second parameter (case-insensitive), e.g. startswith(Title,'1.1')">startswith</a>
						<a href="#" rel="1" class='resttag' itag="tolower(x)" title="filter method: returns the first parameter converted to lowercase, e.g. tolower(Title) eq 'test'">tolower</a>
						<a href="#" rel="1" class='resttag' itag="toupper(x)" title="filter method: returns the first parameter converted to uppercase, e.g. toupper(Title) eq 'TEST'">toupper</a>
						<a href="#" rel="1" class='resttag' itag="trim(x)" title="filter method: returns the first parameter with all leading/trailing spaces removed, e.g. trim(Title) eq 'Test'">trim</a>
						<a href="#" rel="2" class='resttag' itag="substring(x,y)" title="filter method: returns the substring of the first parameter starting at the zero-based index of the second parameter, e.g. substring(Title,5) eq 'Item 1'">substring</a>
						<a href="#" rel="1" class='resttag' itag="substringof(x,y)" title="filter method: returns true if the second parameter contains the first parameter, e.g. substringof('test item',Title)">substringof</a>
						<a href="#" rel="1" class='resttag' itag="concat(x,y,z)" title="filter method: returns the concatenation of the parameters listed in the order listed, e.g. concat('A:',Title) eq 'A:Title'">concat</a>
						<a href="#" rel="2" class='resttag' itag="length(x)" title="filter method: returns the length of the first parameter, e.g. length(Title) gt 10">length</a>
						<a href="#" rel="1" class='resttag' itag="year(x)" title="filter method: returns the year component of the first parameter, e.g. year(Created) eq 2013">year</a>
						<a href="#" rel="1" class='resttag' itag="month(x)" title="filter method: returns the month component of the first parameter, e.g. month(Created) eq 12">month</a>
						<a href="#" rel="1" class='resttag' itag="day(x)" title="filter method: returns the day component of the first parameter, e.g. day(Created) eq 31">day</a>
						<a href="#" rel="1" class='resttag' itag="hour(x)" title="filter method: returns the hour component of the first parameter, e.g. hour(Created) eq 12">hour</a>
						<a href="#" rel="1" class='resttag' itag="minute(x)" title="filter method: returns the minute component of the first parameter, e.g. minute(Created) eq 20">minute</a>
						<a href="#" rel="1" class='resttag' itag="second(x)" title="filter method: returns the second component of the first parameter, e.g. second(Created) eq 30">second</a>
						<a href="#" rel="1" class='resttag' itag="round(x)" title="filter method: returns the nearest integral value of the first parameter, e.g. round(NumColumn) eq 1">round</a>
						<a href="#" rel="1" class='resttag' itag="floor(x)" title="filter method: returns the largest integral value less or equal to the first parameter, e.g. floor(NumColumn) eq 1">floor</a>
						<a href="#" rel="1" class='resttag' itag="ceiling(x)" title="filter method: returns the smallest integral value greater or equal to the first parameter, e.g. ceiling(NumColumn) eq 1">ceiling</a>
					</div>
				</div>
				<div id="air-middleouter" class="air-boxmodel border">
					<div id="air-middleinner">
						<h3>Lists:</h3>
						<ul id="listsmenu">
							<li class="">
								<a id="choose" >Choose a List..</a>
								<ul id="lists"></ul>
							</li>
						</ul>
						<input id="listtitle" type="text" title="enter the list title if the list required is not shown in the picker"/>
						<h3>Columns:</h3>
						<div id="columns" title="click on a column name to add it to the query input">
						</div>
					</div>
				</div>
				<div id="air-rightouter" class="air-boxmodel border">
					<div id="air-rightinner">
						<h3>Url:</h3>
						<div id="resturl" class="paletteborder">
							<a id="resturlcopy" href='#' title='copy url'>.</a>
							<div></div>
						</div>
						<h3>Results:</h3>
						<div id="results" class="paletteborder">
						</div>
					</div>
				</div>
				<div class="clearfix"></div>
			</div>
			<div id="error" class="border"></div>
			<div id="webparts">
				<table width="100%">
						<tr><td></td></tr>
						<tr>
							<td id="Td1" name="_invisibleIfEmpty" valign="top" width="100%"> 
							<WebPartPages:WebPartZone runat="server" Title="loc:FullPage" ID="WebPartZone1" FrameType="TitleBarOnly"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td>
						</tr>
				</table>
			</div>
		</div>
		<div id="col-dialog" style="display:none;">
			<p class="">Add column &#39;<span id="col-dialog-name"></span>&#39; to REST 
			Query Option:</p>
		</div>
	</div>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
Adventures in SharePoint REST - 
<SharePoint:ProjectProperty ID="ProjectProperty1" Property="Title" runat="server"/>
</asp:Content>

<asp:Content ID="Content11" ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
Adventures in SharePoint REST     
</asp:Content>
